package cn.wolfcode.springboot_consumer.once;

import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.annotation.SelectorType;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(
        topic = "boot-01-hello",
        consumerGroup = "boot-consumer-demo",
        //消费模式
        //messageModel = MessageModel.BROADCASTING,
        //标签
        selectorType = SelectorType.SQL92,
        selectorExpression = "age > 15"

)
public class Consumer implements RocketMQListener<String> {
    @Override
    public void onMessage(String str) {
        System.out.println("消费消息2" + str);
    }
}
